<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>js构造函数</title>
		
	</head>
	<body>
	</body>
	<script>
			function Driver(n,s,a)
			{
				this.name=n;
				this.sex=s;
				this.age=a;
				this.showInfo=function(){
					return this.name+","+this.age+",性别:"+this.sex;
				}
			}
			function Driver(n,s)
			{
				this.name=n;
				this.sex=s;
				 
				this.showInfo=function(){
					return this.name+",性别:"+this.sex ;
				}
			}
			var d1=new Driver("劳金龙","男",21);
			document.body.innerHTML=d1.showInfo();
			var d2=new Driver("什么冬梅","女",23);
			alert(d2.showInfo());
		</script>
</html>
